Configure Logging

Keyfactor Command provides extensive logging for visibility and troubleshooting. By default, Keyfactor Command places its log files in the C:\Keyfactor\logs directory, generates logs at the "Info" logging level and stores the primary logs for two days before deleting them. If you wish to change these defaults you can open the configuration file for each type of log on each Keyfactor Command server where you wish to adjust logging, and edit the file in a text editor (e.g. Notepad) using the "Run as administrator" option. Each component now has its own NLog configuration file and NLog logging output path.

Note:  By default, the filename for each component log is unique. This allows you to isolate and research issues on a component-by-component basis by viewing a specific log file. Alternatively, you may wish to change the default output filename to be the same for all logging components so all activity is reported in a single log file. You will note that the default Audit and Alert filenames for each component (for those components that log audits or alerts) are the same so that all activity is logged in the same file across the platform for this reason.
Tip:  If you use the default naming convention, and want to review an event that happened in the management portal, for instance, you would look in the Command_APIClosed A set of functions to allow creation of applications. Keyfactor offers the Keyfactor API, which allows third-party software to integrate with the advanced certificate enrollment and management features of Keyfactor Command._Log.txt and/or the Command_Portal_Log.txt.
Important:  If you do choose to name the log files the same across the platform, it is recommended that you also set the maxArchiveFiles values the same in each Nlog config file. If there is a different value for maxArchiveFiles for files with the same filename/location, the smallest value will override all others.

The Nlog.config files are located in the installation directory for the product under a subdirectory for the given type of logging. By default, these locations are:

  • C:\Program Files\Keyfactor\Keyfactor Platform\Configuration\NLog_Configuration.config

    The Configuration file logs activity related to running the Keyfactor Command configuration wizard only.

  • C:\Program Files\Keyfactor\Keyfactor Platform\KeyfactorAPI\NLog_KeyfactorAPI.config

    The Keyfactor API file is the primary file for logging activity related to running the Keyfactor API. The Keyfactor API is used both for some basic underlying functionality of Keyfactor Command and for any API applications written against it by customers, so the log will show activity related to running the Management Portal as well as external API activity.

  • C:\Program Files\Keyfactor\Keyfactor Platform\Service\NLog_TimerService.config

    The Service file logs activity related to scheduled and automated events within Keyfactor Command.

  • C:\Program Files\Keyfactor\Keyfactor Platform\WebAgentServices\NLog_Orchestrators.config

    The Orchestrators, or Orchestrators API, file logs activity related to Keyfactor Orchestrators API.

  • C:\Program Files\Keyfactor\Keyfactor Platform\WebAPI\NLog_ClassicAPI.config

    The Classsic API file logs activity involving the Classic API from Keyfactor Command.

  • C:\Program Files\Keyfactor\Keyfactor Platform\WebConsole\NLog_Portal.config

    The Portal file is for logging any activity to do with the Keyfactor Command web portal. Keyfactor is migrating the product to use mostly the Keyfactor API, so this file will have less activity going forward. See C:\Program Files\Keyfactor\Keyfactor Platform\KeyfactorAPI\NLog_KeyfactorAPI.config

Once configured, output from the file locations defined will look similar to this:

Figure 510: C:\Keyfactor\logs logs